{% extends 'assets/base.html' %}
{% block content %}
    <div class="row wrapper border-bottom white-bg page-heading">
        <div class="col-lg-10">
            <h2>IDC机房列表 | List IDC.</h2>
        </div>
        <div class="col-lg-2">
        </div>
    </div>

    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5> IDC机房列表 </h5>
                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                        <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                            <i class="fa fa-wrench"></i>
                        </a>
                        <ul class="dropdown-menu dropdown-user"></ul>
                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                </div>

                <div class="ibox-content">
                    <table class="table table-striped table-bordered table-hover">
                        <thead>
                        <tr>
                            <th class="text-center">机房名称</th>
                            <th class="text-center">带宽</th>
                            <th class="text-center">运营商</th>
                            <th class="text-center">联系人</th>
                            <th class="text-center">联系电话</th>
                            <th class="text-center">备注</th>
                            <th class="text-center">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {% for idc in idc_list_objs %}
                            <tr>
                                <td class="text-center">{{ idc.name }}</td>
                                <td class="text-center">{{ idc.bandwidth }}</td>
                                <td class="text-center">{{ idc.get_operator_display }}</td>
                                <td class="text-center">{{ idc.linkman }}</td>
                                <td class="text-center">{{ idc.phone }}</td>
                                <td class="text-center">{{ idc.comment }}</td>
                                <td class="text-center">
                                    <div class="btn-group" data-toggle="buttons">
                                        <a href="{% url 'idc_update' pk=idc.pk %}" class="btn btn-xs btn-success "
                                           data-toggle="modal">修改</a>
                                        <a href="{% url 'idc_delete' pk=idc.pk %}" class="btn btn-xs btn-danger"
                                           data-toggle="modal">删除</a>
                                    </div>
                                </td>
                            </tr>
                        {% endfor %}
                        </tbody>
                    </table>

                    <div class="row">
                        <div class="col-sm-6">
                            {% if request.user.is_superuser or request.session.fun_auth.add_idc %}
                                <a href="{% url 'idc_create' %}" type="button" class="btn btn-info">添加IDC</a>
                            {% endif %}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

{% endblock content %}
